<?php
namespace functions\attributes\components\LinkTree;

function titlePre($element)
{
	if (!$element->AttributeExists('title') || !$element->GetAttribute('title'))
	{
		$page = core("Page")->GetCurrentPageName();
		$page = core("Page")->GetPageParams($page, "title");

		$element->AddAttribute('title', $page);
	}

	return true;
}